Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use anchor for resource links #773

Closed
wants to merge 1 commit into from
Closed

Conversation

victorlin
Copy link
Member

Description of proposed changes

The previous "links" relied on onClick which is bad for accessibility. If div is still desired, the link role would be appropriate.¹ Or, use an anchor element instead, as done in this commit.

¹ https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/link_role

Related issue(s)

N/A

Checklist

  • Checks pass
  • Make the same change in Auspice

The previous "links" relied on onClick which is bad for accessibility.
If div is still desired, the link role would be appropriate.¹ Or, use an
anchor element instead, as done in this commit.

¹ <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/link_role>
@victorlin victorlin self-assigned this Jan 3, 2024
@nextstrain-bot nextstrain-bot temporarily deployed to nextstrain-s-victorlin--qtfpsm January 3, 2024 01:33 Inactive
Comment on lines +122 to +124
function formatDataset(requestPath) {

// FIXME: Do we actually need dispatch and changePage here? I've removed them for now.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is my main concern - it's not clear to me what dispatch and changePage were used for. Seems to work fine without it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The behaviour will be a little different -- dispatching stays within the SPA, whereas links will go to a new URL, fetch the auspice HTML entrypoint, fetch the auspice JS (cache hit), reparse the JS and so on. In practice, the Auspice splash page within nextstrain.org is used rarely - perhaps only for community data?

P.S. I've wanted proper link behaviour for a while now, especially in the default Auspice splash page.

@victorlin
Copy link
Member Author

Closing since the plan is to remove this file: #1090

@victorlin victorlin closed this Jan 23, 2025
@victorlin victorlin deleted the victorlin/auspice-splash branch January 23, 2025 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants